Repository navigation
Conversation
…ue/20917-12242-negotiated-screenpatch-v2
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ca23c9a54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let line = match &opts.cwd { | ||
| Some(dir) => format!("cd {} && {command}", sh_quote(dir)), | ||
| None => command, | ||
| }; | ||
| ("sh".to_string(), vec!["-lc".to_string(), line]) |
There was a problem hiding this comment.
Apply the build lock when running locally on the laptop
When fleet shell --build -- cargo test ... runs on the laptop, resolve() selects Target::Local, but this arm ignores opts.build and executes the command directly. Only the remote Target::Laptop arm adds fleet-build-lock. The normal laptop invocation therefore bypasses the fleet-wide build concurrency limit and target-broker setup despite explicitly requesting a build slot. Preserve the lock for local execution when the resolved seat is the laptop.
AGENTS.md reference: AGENTS.md:L30-L32
Useful? React with 👍 / 👎.
| let _ = shortlist::update(file, now, |list| { | ||
| list.handed.push(shortlist::Handed { | ||
| repo: entry.repo.clone(), | ||
| issue: entry.issue, | ||
| to: agent.clone(), |
There was a problem hiding this comment.
Recheck priority handouts inside the shortlist lock
When two same-host runs reach the priority fallback concurrently, both can load the same handed snapshot and select the same issue before either records its handout. Although shortlist::update locks the write, its closure appends unconditionally without rechecking recently_handed, so both agents receive the same issue despite the two-hour duplicate suppression. Select an eligible candidate and record its handout together inside the locked update.
Useful? React with 👍 / 👎.
| let path = format!( | ||
| "repos/{repo}/issues?state=open&labels={}&per_page=30&sort=created&direction=asc", | ||
| encode_label(label) | ||
| ); | ||
| let page = match gh_api(world, &path, route) { |
There was a problem hiding this comment.
Search subsequent pages before declaring priority work unavailable
If the oldest 30 open items for a priority label are held, busy, tracker issues, pull requests, or hands items, the filtering below removes all of them without examining eligible issues on later pages. This can make agent next report no priority work or select lower-priority work indefinitely, and prevents shortlist fill from finding those issues. Both routes in gh_api() issue a single request; the fleet wrapper passes the arguments through unchanged. The installed gh api --help documents --paginate as “Make additional HTTP requests to fetch all pages of results”; no pagination is requested here. Fetch subsequent pages until enough eligible candidates are found or the label's results are exhausted.
Useful? React with 👍 / 👎.
| args.push(if opts.build { | ||
| format!("{BUILD_LOCK} {command}") |
There was a problem hiding this comment.
Run the complete remote shell program under the build lock
For the supported single-argument shell-program form, fleet shell --target laptop --build -- 'cd pkgs/id && cargo test' produces ~/tools/fleet-build-lock cd pkgs/id && cargo test. The lock wrapper ends with exec "$@", so it attempts to execute the shell builtin cd as an external program and fails before building. With 'cargo check && cargo test', the second build instead runs after the lock has been released. Invoke a shell underneath the lock with the complete, quoted command string so compound build programs execute correctly and remain locked throughout.
AGENTS.md reference: AGENTS.md:L30-L32
Useful? React with 👍 / 👎.
…ue/20917-12242-negotiated-screenpatch-v2
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b575e1552
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ug placement Reconciles with PR #12246 (the earlier queue implementation of this slice): adopt its recorded design decision that binary delivery is an explicit client opt-in — the join frame's binary_view_patches flag — in addition to the v2 transport negotiation. Both halves are required before a patch rides a binary frame; a v2 session without the flag keeps JSON patches (new session test pins this). Also fixes the WorldClientFrame insertion, which had landed between WorldClient's doc comment and its derive(Debug).
|
Closing as superseded — the F12.11 phase 3 work landed through two other PRs, and this branch's implementation should not be merged:
Why not this PR: its codec is a flat envelope that replaces the merged #12241 codec and its golden vectors; its framed transports carry no kind/marker byte and its Rust client cannot consume its own v2 frames; its final head (3751be8) was never test-run (its own body notes this). Its design note's join-opt-in argument was adopted in substance — the merged design gates binary on the join's Disposition of the review findings on this PR:
Thanks to the author for the early design work — the negotiation question it opened (explicit opt-in vs endpoint-only) is settled in the merged contract's offer-and-observe rule. |
A resume token's retained baseline records the viewport that produced it, but joined() initialized every connection's viewport to None, so the first resumed view rendered at the program's default size and the shape-checked consume in send_view always missed for a baseline retained at a non-default viewport. The resume was silently a full view every time. BaselineCache gains a participant-bound, non-consuming peek (viewport_for); joined() restores the viewport from the retained baseline before the first send_view consumes the one-shot token. take_matching still performs the shape-checked consume, and a miss still falls back to a full view. The wrong-viewport test is replaced by the regression this behavior needs: a_resume_token_restores_the_viewport_before_catching_up (the test PR #12246 wrote but never ran), plus a unit test pinning that the peek does not consume. Ported from PR #12246 commit 3751be8, adapted to the post-#12242 session shape. Refs #12648
The browser never participated in resume: world.ts did not declare resume_token on the frame type, never adopted the token view frames carry, never offered one in the join frame, and connect() cleared the rendered surface and revision on every reconnect — so even a host willing to send a catch-up patch had nothing to patch against. Token, surface, and revision now move as one unit: adopted together from every applied view (JSON and MessagePack paths), offered in the join frame when the unit is complete, and retained across reconnects. A same-size resize no longer goes out on a resumable reconnect (it resets the host's retained baseline); a real viewport change or a forced resync drops all three together and asks for a full view. Host view (the read-only HTTP path) clears the token with the surface, since its renders are not session baselines. New world-resume.test.ts carries the coverage #12648 names: a catch-up patch applies after a reconnect with no intervening resize, and a viewport change drops the unit. Adapted from PR #12246 commit 2b9428d to the screen_msgpack negotiation that landed in #12242. Refs #12648
Summary
Stacked on PR #12241, this implements the negotiated transport slice for #12242:
join opts into screen_patches + binary_view_patches
-> supported v2 binary route (versioned ScreenPatch + cursor/revision)
-> malformed frame or patch gap requests viewport resync
otherwise
-> existing v1 text-JSON path
Carries text and bytes through the Rust session adapters and browser WebSocket path. Reconnects retain the matching rendered screen/revision with the resume token. The server restores the participant-bound viewport from the retained baseline before rendering the first resumed view. Compression and bandwidth measurement remain out of scope.
Evidence
The following checks passed on commit 1b575e1, before the latest viewport-restoration change:
Latest commit 3751be8 adds a Rust integration regression test that reconnects at a non-default viewport and applies a catch-up patch. That test has not yet been run on the latest head; GitHub currently reports no workflow runs or status checks for it.
A package-wide cargo fmt --check reports an existing formatting diff in pkgs/id/benches/world_bench.rs, outside this stacked PR's diff.
Merge Danger
Door: Two-way; the new path is opt-in and v1 text-JSON remains available.
Blast Radius: Medium — negotiated world-session transport across Rust adapters and the browser WebSocket client.
Depends on #12241 landing first. References #12242; it is intentionally not auto-closing because this PR is stacked on a non-default base.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.